home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / lockobj.pvrx < prev    next >
Text File  |  1991-07-18  |  2KB  |  64 lines

  1. /* LockObj.pvrx
  2.    Copyright © 1991 by Stylus, Inc.
  3.    Author - Jeff Blume
  4.  
  5. To run from its own User Menu item, add this line to
  6.     ProVector.pvrx:  'Define "LockObj" "LockObj MENU"'
  7.  
  8. To run from User/Rexxecute type "MENU" after the filename in the
  9.     macro file requester.  Thus 'File' text gadget
  10.     should read "LockObj  MENU".
  11.  
  12. *************** ROSS ************************************
  13. Will lock out most operations, but not ReLayer Obj..., Align
  14.     by Points...
  15. Can't "CHANGE Anyway" even if it did parse the 8th and 9th args.
  16.     So should trap "CHANGE Anyway" and say can't!
  17. *************** ROSS ************************************
  18.  
  19. */
  20.  
  21. options results 
  22.  
  23. /* Get the argument list to see whether this is a MENU, or a CallBack */
  24. arg arglist
  25. Cmd = word(arglist,1)
  26. Obj = word(arglist,2)
  27.  
  28. /* Always do this for a ProVector AREXX macro */
  29. /* This waits its turn to execute */
  30. 'Lock Wait'
  31.  
  32. if Cmd = 'MENU' then do        /* This was called from the menu */
  33.                 /* "Lock" all selected objs with callback */
  34.     'SelectList' Sel; SelN = Result
  35.     do i = 0 to SelN-1
  36.         'Rexx' Sel.i LockObj UnGroup Clone Move Rotate Size Change Delete Cut Copy
  37.     end
  38. end
  39.  
  40. else if Cmd = 'UNGROUP' then do
  41.     'GetBool "Unlock object?" "Yes" "No"'
  42.     if RC = 0 then do
  43.         /* Decrement the lock counter */
  44.         'UnGroup Obj'
  45.     end
  46. end
  47.  
  48. else do                /* This was a CallBack */
  49.     Prompt = '"Object Locked! '||Cmd||' Anyway?"'
  50.     'GetBool'  Prompt Yes No
  51.     if RC = 0 then do
  52.         /*interpret arglist*/
  53.         /*neg value in args evaluated as expression (breaks)*/
  54.         command = '"'||word(arglist,1)||'" "'||word(arglist,2)||'" "'||word(arglist,3)||'" "'||word(arglist,4)||'" "'||word(arglist,5)||'" "'||word(arglist,6)||'"'
  55.         interpret command
  56.         'Repair'
  57.         'GetBool "Still Locked! UnGroup to UnLock." OK OK'
  58.     end
  59.     else 'GetBool "Use UnGroup tool to UnLock." OK OK'
  60. end
  61.  
  62. /* All done!  Unlock ProVector */
  63. 'UnLock'
  64.